package com.amos.base.base;

import com.alibaba.fastjson.annotation.JSONField;
import com.amos.base.util.NullUtils;

import java.util.Date;

/**
 * @author Amos
 * @ClassName BaseDTO
 * @Description 基类DTO
 * @Date 2018/12/22 22:37
 * @VERSION 1.0
 **/
public class BaseDTO extends DefaultDTO{
    private String id;
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private Date modifyTime;
    private String createUser;
    private String modifyUser;
    private Integer status;
    private Integer isDelete;

    /**
     * 判断是新增还是修改
     * true 是新增  false 修改
     * @return
     */
    public boolean isNew(){
        return NullUtils.isEmpty(id);
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getModifyTime() {
        return modifyTime;
    }

    public void setModifyTime(Date modifyTime) {
        this.modifyTime = modifyTime;
    }

    public String getCreateUser() {
        return createUser;
    }

    public void setCreateUser(String createUser) {
        this.createUser = createUser;
    }

    public String getModifyUser() {
        return modifyUser;
    }

    public void setModifyUser(String modifyUser) {
        this.modifyUser = modifyUser;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public Integer getIsDelete() {
        return isDelete;
    }

    public void setIsDelete(Integer isDelete) {
        this.isDelete = isDelete;
    }
}
